package main

import (
	"fmt"
	"os"
	"runtime"
)

func main() {
	fmt.Println("操作系统类型")
	fmt.Println(runtime.GOARCH)  //amd64
	fmt.Println(runtime.GOOS)  //windows
	fmt.Println(runtime.GOROOT())

	fmt.Println()
	switch runtime.GOOS {
	case "darwin":
		fmt.Println("MacOS系统")
	case "windows":
		fmt.Println("Windows操作系统")
	case "linux":
		fmt.Println("Linux操作系统")
	default:
		fmt.Println("未知")
	}

	fmt.Println(os.Hostname())

}
